<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/1/23
 * Time: 9:05
 */

namespace Home\Controller;
use Think\Controller;

    class HomeController extends Controller
    {
        /**
         * 调用模板中的控制器中的方法不存在时,自动调用此方法
         */
        public function _empty()
        {
            echo '<h1>404 not found</h1>';
            echo '<h1>404 找不到该网页</h1>';
        }
        //数字验证码
        public function verify()
        {
            $verify = new \Think\Verify();
            $verify -> length = 4;
            $verify-> codeSet = '0123456789';
            $verify -> entry();
        }
        //判断是否登录
        public function isLogin ()
        {
            if(empty(session("home"))){
                $this->success("请先登录",U("User/login"));
                die;
            }
        }

    }